package com.example.demo.controller;

import com.example.demo.entity.Finance;
import com.example.demo.entity.Order;
import com.example.demo.entity.Users;
import com.example.demo.service.FinanService;
import com.example.demo.util.JsonResult;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@Slf4j
@RequestMapping("/sys-Finance")
public class FinanceController {
    @Autowired
    FinanService finanService;
    @GetMapping("/finances")
    public JsonResult<Users<Finance>> orderList(@RequestParam("pagenum") int pageNum, @RequestParam("pagesize") int pageSize, @RequestParam("query")String query){
        Users<Finance> users = finanService.page((pageNum - 1) * pageSize, pageSize, query);
        return new JsonResult<>(200,users);
    }
}
